*** Qualifications: Gender gap in mathematically intensive subjects, Table 9

clear
use "${data}cleaned_data_y3.dta"
do "${blocks}construct_new_variables"

do "${blocks}variables_sample_as"
drop if GCSEAStarCount == .

egen mean_astar = mean(GCSEAStarCount)
egen sd_astar   = sd(GCSEAStarCount)
gen std_astar   = (GCSEAStarCount - mean_astar) / sd_astar
label var std_astar "Number of A* in General exams"

label var std_maths_percent "Math score"
label var maths_modules "Math modules"

***

reg ns_std_perc_y1 i.type i.Course_NatSci_split  i.ApplyCollege if EEMP == 1, vce(robust)
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
eststo r1

reg ns_std_perc_y1 i.type std_astar std_maths_percent maths_modules i.Course_NatSci_split  i.ApplyCollege if EEMP == 1, vce(robust)
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
eststo r2

reg ns_std_perc_y1 i.type std_astar std_maths_percent maths_modules i.type#c.std_astar i.type#c.std_maths_percent i.type#c.maths_modules i.Course_NatSci_split  i.ApplyCollege if EEMP == 1, vce(robust)
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
eststo r3

esttab r1 r2 r3 using "${tables}gender_pre_admission_test.tex", cells(b(pval(pval) fmt(2)) se(par fmt(2))) keep(2.type std_astar std_maths_percent maths_modules 2.type#c.std_astar 2.type#c.std_maths_percent 2.type#c.maths_modules) collabels(none) ///
scalars("course_fe Subject FE" ///
"apply_college_fe Application college FE") ///
eqlabels(none) label varwidth(25) nonumbers  posthead("& (1) & (2) & (3) \\ \midrule") nonumbers mlabels(none) se(%9.2f) ///
gaps booktabs nonotes ///
replace
*/
